<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>建设单位待办--建设遴选--审查机构遴选</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <!--<script type="text/javascript" src="/templates/act/process-xl.js"></script>-->
    <style>
        body {
            box-sizing: border-box;
            -moz-box-sizing: border-box; /* Firefox */
            -webkit-box-sizing: border-box; /* Safari */
            padding: 30px 30px;
        }

        h3 {
            font-weight: bold;
            display: inline;
        }

        .title {
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
<div class="title">
    <h3>项目名称:</h3>
    <h3 id="prjName" style="margin-left: 20px"></h3>
</div>
<form class="layui-form" action="">
    <table class="layui-hide" id="dataList" lay-filter="dataList"></table>
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">机构详情</a>
    </script>
</form>
<script src="/static/js/main.js"></script>
<script type="text/javascript">
    var table = {};
    layui.use(['configureCom', 'configure', 'bluebird', 'sessionFun', 'jquery', 'table'], function () {
        var configure = layui.configure;
        var configureCom = layui.configureCom;
        var sessionFun = layui.sessionFun;
        table = layui.table;
        var $ = layui.jquery;
        var listData = sessionFun.get(configure.SESSION_PROJECT_WAIT_LIST_DATA);
        $('#prjName').html(listData.prjName);//项目名

        var cols = [[
            {type: 'radio'},
            {field: 'orgName', title: '机构名'},
            {title: '操作', toolbar: '#barDemo', width: 100}
        ]];
        configureCom.postDataAjax(configure.PROJECT_RANDOM_APTITUDE_ORG_HTTP,{decId:listData.decId,prjId:listData.prjId}).then(function (res) {
            var data = res.list;
            configureCom.tableRenderUserDefined({}, cols, data, 'dataList');
        });

        //每行操作
        table.on('tool(dataList)', function (obj) {
            var data = obj.data;
            sessionFun.set(configure.SESSION_INSTITUTIONAL_DETAILS_DATA, data)
            if (obj.event === 'detail') {
                top.layer.open({
                    type: 2,
                    title: '机构详情',
                    area: configureCom.Psize1,
                    content: configure.UNIT_MECHANISM_DETAILN_HTML
                });
            }
        });
        //监听submit提交
        form.on('submit(submit)', function (data) {
            return false;
        });
    })

    function getData() {
        return new Promise(function (res, rej) {
            var data = table.checkStatus('dataList').data;
            res({result: data});
        });
    }
</script>
</body>
</html>